If a GLXPbuffer is created with GLX_CONTENTS_PRESERVED_SGIX set to False, the storage for the buffer contents--or a portion of the buffer contents--may be lost at any time. It is not an error to render to a GLXPbuffer that is in this state, but the effect of rendering to it is undefined. It is also not an error to query the pixel contents of such a GLXPbuffer, but the values of the returned pixels are undefined.
Because the contents of a volatile GLXPbuffer can be lost at any time with only asynchronous notification (via the "buffer clobber" event), the only way a client can guarantee that valid pixels are read back with glReadPixels() is by grabbing the X server. (Note that this operation is potentially expensive and you should not do it frequently. Also, since this locks out other X clients, you should do it only for short periods of time.) Clients that don't wish to do this can check if the data returned by glReadPixels() is valid by calling XSync() and then checking the event queue for "buffer clobber" events (assuming that these events were pulled off of the queue before the glReadPixels() call).
To destroy a GLXPbuffer call glXDestroyGLXPbufferSGIX():
void glXDestroyGLXPbufferSGIX(Display *dpy, GLXPbuffer pbuf)To query an attribute associated with a GLXPbuffer, call glXQueryGLXPbufferSGIX().
void glXQueryGLXPbufferSGIX(Display *dpy, GLXPbuffer pbuf, int attribute unsigned int *value)To get the GLXFBConfig for a GLXPbuffer, first retrieve the ID for the GLXFBConfig and then call glXChooseFBConfigSGIX(). See "The Framebuffer Configuration Extension".